<div class="span12">
    <div class="box box-color box-bordered">
        <div class="box-title">
            <h3>
                <i class="icon-table"></i>
                Locales
            </h3>
            <div class="actions">
                <?php if (myCapability::testcap($caps, myCapability::C('CAP_M_ADMIN_CREATE'))) { ?>
                    <a href="<?php echo url_for('adminstores/addStores'); ?>" class='btn'>
                        <i class="icon-plus-sign"></i>Agregar Locales</a>
                <?php } ?>
            </div>
        </div>
        <div class="box-content nopadding">
            <table class="table table-bordered dataTable dataTable-scroll-x">
                <thead>
                    <tr>
                        <th>Canal</th>
                        <th>Cliente</th>
                        <th>Cadena / Formato</th>
                        <th>Cód. Formato</th>
                        <th>Concesión</th>
                        <th>Ubicación</th>
                        <th>Cód. Proveedor</th>
                        <th>Cód. Local</th>
                        <th>Cód. RB</th>
                        <th>Nombre</th>
                        <th>Dirección</th>
                        <th>Comuna</th>
                        <th>Provincia</th>
                        <th>Región</th>
                        <th>País</th>
                        <th>Superficie</th>
                        <th>Cluster</th>
                        <th>Responsable1</th>
                        <th>Responsable2</th>
                        <th>Responsable3</th>
                        <th>Gerente</th>
                        <th>Administrador</th>
                        <th>Vta. Promedio</th>
                        <th>&nbsp;</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($stores as $value) { ?>

                        <tr>
                            <td><?php echo $value['Channels']['name']; ?></td>
                            <td><?php echo $value['Customers']['name']; ?></td>
                            <td><?php echo $value['Formats']['name']; ?></td>
                            <td><?php echo $value['CodeFormats']['name']; ?></td>
                            <td><?php echo $value['Concessions']['name']; ?></td>
                            <td></td>
                            <td><?php echo $value['code_supplier']; ?></td>
                            <td><?php echo $value['code_store']; ?></td>
                            <td><?php echo $value['id_store']; ?></td>
                            <td><?php echo $value['name']; ?></td>
                            <td><?php echo $value['address']; ?></td>
                            <td><?php echo $value['Comunas']['name']; ?></td>
                            <td><?php echo $value['Provincias']['name']; ?></td>
                            <td><?php echo $value['Regiones']['name']; ?></td>
                            <td><?php echo $value['Paises']['name']; ?></td>
                            <td><?php echo $value['sourface']; ?></td>
                            <td><?php echo $value['Clusters']['name']; ?></td>
                            <td><?php echo $value['responsiblea']; ?></td>
                            <td><?php echo $value['responsibleb']; ?></td>
                            <td><?php echo $value['responsiblec']; ?></td>
                            <td><?php echo $value['manager']; ?></td>
                            <td><?php echo $value['administrator']; ?></td>
                            <td><?php echo $value['averange_sales']; ?></td>
                            <td>
                                 <?php if (myCapability::testcap($caps, myCapability::C('CAP_M_ADMIN_UPDATE'))) { ?> 
                                    <a href="<?php echo url_for('adminstores/editStore'); ?>?id=<?php echo $value['id_store']; ?>">
                                        <button class="btn"><i class="icon-edit"></button></i>
                                    </a>
                                <?php } ?>
                            </td>
                        </tr>
                    <?php } ?>

                </tbody>
            </table>
        </div>
    </div>
</div>